import React, { Component } from 'react'
import {
    StyleSheet,
    Text,
    View,
} from 'react-native'
import { withNavigation } from 'react-navigation'
import {deviceWidth} from "src/util"
import Banner from 'src/components/Banner'
import Notice from 'src/routers/Home/components/notice'
import HomeCenter from 'src/routers/Home/components/HomeCenter'
import HomeModel from 'src/routers/Home/components/HomeModel'

@withNavigation
export default class Index extends Component <{}> {
    constructor (props) {
        super(props)
    }
    
    render () {
        return (
            <View style={{flex: 1}}>
                <Banner dataSource={this.props.config.banner} />
                <Notice notice={this.props.config.notice}/>
                <HomeCenter nav={this.props.config.nav}/>
                <HomeModel module={this.props.config.module}/>
            </View>
        )
    }
}
const styles = StyleSheet.create({
    container: {
        flex: 1
    },
    dotStyle: {
        width: 5,
        height: 5,
        backgroundColor: '#fff',
        opacity: 0.4,
        borderRadius: 2.5
    },
    activeDotStyle: {
        width: 5,
        height: 5,
        backgroundColor: '#fff',
        borderRadius: 2.5
    },
    paginationStyle: {
        bottom: 6
    },
    wrapper: {
        width: deviceWidth,
        height: (200*deviceWidth)/375
    }
})
